import com.gitee.feizns.dynamic.Strings;
import com.gitee.feizns.dynamic.bean.Beans;
import lombok.Data;

/**
 * @author feizns
 * @since 2023/1/1
 */
public class Main {

//    public static void main(String[] args) {
//        A a = new A();
//        B b = new B();
//        b.setId(12L);
//        a.setB(b);
//        a.setId(123L);
//        a.setBs(Arrays.asList(b, b));
//        a.setBmap(MapUtils.create("map", "12312313", "map2", "12312313123123"));
//        System.out.println(a);
////        PropUtils.
//        System.out.println(a.toMap());
//        Map<String, Object> map = a.toMap();
//        System.out.println(map);
//    }
//
//    @Data
//    public static class A implements Convertible {
//        private Long id;
//        private B b;
//        private List<B> bs;
//        private Map<String, Object> bmap;
//    }
//    @Data
//    public static class B {
//        private Long id;
//    }

    public static void main(String[] args) {
        @Data
        class A { int type_id = 1024; String type_name = "abc"; }

        @Data
        class B { int typeId = 1; }

        A a = new A();
        B b = new B();

        //（将原先type_id的值映射到typeId）输出的结果为：B(typeId=1024)
        System.out.println(Beans.copyProperties(b, Strings::toCamelCase, a));
        //B(typeId=1024)
        System.out.println(b);
    }

}
